#include <stdio.h>
#include <math.h>

int prime( int p );
int PrimeSum( int m, int n );

int main()
{
    int m, n, p;

    scanf("%d %d", &m, &n);
    printf("Sum of ( ");
    for( p=m; p<=n; p++ ) {
        if( prime(p) != 0 )
            printf("%d ", p);
    }
    printf(") = %d\n", PrimeSum(m, n));

    return 0;
}

int prime( int p )
{
    if (p < 2)
    {
        return 0;
    }
    else
    {
        for (int i = 2; i < (int)sqrt(p) + 1; i++)
        {
            if (p % i == 0)
            {
                return 0;
            }
        }
        return 1;
    }
}

int PrimeSum( int m, int n )
{
    int s = 0;
    for (int i = m; i < n + 1; i++)
    {
        if (prime(i))
        {
            s += i;
        }
    }
    return s;
}